package com.demo.controller.admin;

import com.demo.common.model.Baseinformation;
import com.demo.controller.BaseController;
/**
 * 
 * @author Emode
 * 网站基本信息设置
 */
public class BaseInfoAdminController extends BaseController<Baseinformation>{
	
	public void index(){
		setAttr("info", Baseinformation.me.getBaseInfo());
		render("/admin/system/system-base.html");
	}
	
	public void update(){
		Baseinformation base = new Baseinformation();
		String id = getPara("id");
		String title = getPara("title");
		String keywords = getPara("keywords");
		String description = getPara("description");
		String icon_url = getPara("icon_url");
		String logo_url = getPara("logo_url");
		String blog_name = getPara("blog_name");
		String mark = getPara("mark");
		String content = getPara("content");
		String copyrightby = getPara("copyrightby");
		String my_template = getPara("my_template");
		boolean bool = false;
		bool = base.set("id", id)
			.set("title", title)
			.set("keywords", keywords)
			.set("description", description)
			.set("icon_url", icon_url)
			.set("logo_url", logo_url)
			.set("blog_name", blog_name)
			.set("mark", mark)
			.set("content", content)
			.set("copyrightby", copyrightby)
			.set("my_template", my_template)
			.update();
		if(bool){
			success("操作成功");
		}else{
			error("操作失败");
		}
	}

}
